
package com.sfdlJPush.api;

import java.util.HashMap;
import java.util.Map;

import android.view.View;

import com.sfdlJPush.controller.api.ApiListenrDefaultImpl;
import com.sfdlJPush.controller.api.B5MBaseRequest;
import com.sfdlJPush.utils.UserInfoManage;
import com.sfdlJPush.utils.VerifyData;

public class ReplyOrderRequest extends B5MBaseRequest<ReplyOrderResponse>
{
    public String title;
    public String content;
    public String enquiryId;

    public ReplyOrderRequest(ApiListenrDefaultImpl apiListenrDefaultImpl, View view)
    {
        super(apiListenrDefaultImpl, view);
        // TODO Auto-generated constructor stub
    }

    @Override
    public Class<ReplyOrderResponse> getResponseClass()
    {
        // TODO Auto-generated method stub
        return ReplyOrderResponse.class;
    }

    @Override
    public String getApiMethod()
    {
        // TODO Auto-generated method stub
        return "CompanyEnquiry/replyOrder";
    }

    @Override
    public void setApiBody(Map<String, String> body)
    {
        // TODO Auto-generated method stub
        body.put("title", title);
        body.put("content", content);
        body.put("enquiryId", enquiryId);
        body.put("sign", getMD5Sign());
    }

    private String getMD5Sign()
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("username", UserInfoManage.getInstance().getUser().username);
        map.put("companyId", UserInfoManage.companyId);
        map.put("title", title);
        map.put("content", content);
        map.put("enquiryId", enquiryId);
        map.put("key", UserInfoManage.getInstance().getUser().key);
        return VerifyData.getMD5Sign(map);
    }
}
